package com.liuhouse.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//配置mybatisPlus的分页插件,使得支持分页查询,这个类直接复制就能用
@Configuration
public class MybatisPlusConfig {
    //使用@Bean进行自动注入
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        //创建mybatisPlus拦截器的实例化对象
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        //添加分页拦截器
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }






}
